from aip import AipOcr

""" 你的 APPID AK SK """
APP_ID = '11322449'
API_KEY = 'EVyjdsDGim5jlRAPSf1wVAv5'
SECRET_KEY = 'eYXPid0PvAL9FK7BeCSylGd0lyEVj348'

client = AipOcr(APP_ID, API_KEY, SECRET_KEY)

""" 读取图片 """


def get_file_content(filePath):
    with open(filePath, 'rb') as fp:
        return fp.read()


image = get_file_content(r'C:\Users\Administrator\Desktop\test\u8eg.jpg')

""" 调用通用文字识别, 图片参数为本地图片 """
j = client.basicAccurate(image)
print(j)